import request from '@/utils/request'

// 创建供应商信息
export function createSupplier(data) {
  return request({
    url: '/base/supplier/create',
    method: 'post',
    data: data
  })
}

// 更新供应商信息
export function updateSupplier(data) {
  return request({
    url: '/base/supplier/update',
    method: 'put',
    data: data
  })
}

// 删除供应商信息
export function deleteSupplier(id) {
  return request({
    url: '/base/supplier/delete?id=' + id,
    method: 'delete'
  })
}

// 获得供应商信息
export function getSupplier(id) {
  return request({
    url: '/base/supplier/get?id=' + id,
    method: 'get'
  })
}

// 获得供应商信息分页
export function getSupplierPage(query) {
  return request({
    url: '/base/supplier/page',
    method: 'get',
    params: query
  })
}

// 获得品牌简单列表
export function getSupplierSimple() {
  return request({
    url: '/base/supplier/list-all-simple',
    method: 'get'
  })
}

// 导出供应商信息 Excel
export function exportSupplierExcel(query) {
  return request({
    url: '/base/supplier/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
